//
//  WFBaseModel.m
//  谷居
//
//  Created by dllo on 16/6/16.
//  Copyright © 2016年 刘万方. All rights reserved.
//

#import "WFBaseModel.h"

@implementation WFBaseModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"description"]) {
        [__description setValue:value forKey:key];
    }
}
+ (NSMutableArray *)baseModelByArray:(NSArray *)arr {
    NSMutableArray *modelArray = [NSMutableArray array];
    for (NSDictionary *temp in arr) {
        @autoreleasepool {
            id model = [[self class] baseModelWithDic:temp];
            [modelArray addObject:model];
        }
    }
    return modelArray;
}

+ (instancetype)baseModelWithDic:(NSDictionary *)dic {
    id model = [[[self class] alloc] initWithDic:dic];
    return [model autorelease];
    
}

- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}



@end
